package ru.ifmo.croak.sample;

import ru.ifmo.croak.api.Message;
import ru.ifmo.croak.api.MessageQuery;
import ru.ifmo.croak.api.PostService;
import ru.ifmo.croak.api.QueryRequest;

import java.util.logging.Logger;

/**
 * Sample implementation of {@link PostService} that just logs messages.
 *
 * @author Roman Elizarov
 */
public class PostServiceImpl implements PostService {
    private final String name;
    private final Logger log;

    public PostServiceImpl(String name) {
        this.name = name;
        log = Logger.getLogger(name);
    }

    public void postMessage(Message message) {
        log.info("Post message " + message);
    }
}
